﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TuyennvLibrary.Attributes
{
    [AttributeUsage(AttributeTargets.Method | AttributeTargets.ReturnValue, AllowMultiple = true, Inherited = false)]
    public sealed class AttributeGroupMethod : Attribute, IComparable<AttributeGroupMethod>
    {
        public int Group { get; set; }
        public int Weight { get; set; }
        public AttributeGroupMethod()
        {
            this.Group = 0;
            this.Weight = 0;
        }
        public AttributeGroupMethod(int Group)
        {
            this.Group = Group;
            this.Weight = 0;
        }
        public AttributeGroupMethod(int Group, int Weight)
        {
            this.Group = Group;
            this.Weight = Weight;
        }
        public int CompareTo(AttributeGroupMethod other)
        {
            if (other == null)
                return 1;
            return this.Weight.CompareTo(other.Weight);
        }
    }
}
